# include to make a console application
define setupCommonVC
	cc := cl
# copts from mathlink application	
#	copts := /nologo /c /DWIN32 /D_WINDOWS /W3 /Z7 /Od /D_DEBUG
	copts := /c /D_DEBUG /EHsc /D"_CONSOLE" /RTC1 /MDd
	objext := obj
	objout := /Fo
	exeout := /Fe
	incdir := $(patsubst %,/I%,$(addincdir))	
	libdir := /nologo /link $(patsubst %,/LIBPATH:%,$(addlibdir))
	libraries := kernel32.lib user32.lib gdi32.lib
	libraries += $(patsubst %,%.lib,$(addlibs))
endef

define setupCommonMinGW
	copts := -c -g -Wall
	objout := -o
	objext := o
	exeout := -o
#perhaps semicolon separted list?
	incdir := $(patsubst %,-I%,$(addincdir))
	libdir := $(patsubst %,-L%,$(addlibdir))
	libraries := $(patsubst %,-l%,$(addlibs))
#	-mwindows if not console?	
#	libraries += $(additionalLibs)
endef

define setupVC71
	$(setupCommonVC)
	copts += /MLd
endef

define setupVC8
	$(setupCommonVC)
	copts += /D_CRT_SECURE_NO_WARNINGS
endef

define setupVC9
	$(setupCommonVC)
	copts += /D_CRT_SECURE_NO_WARNINGS
endef

define setupMinGW
	$(setupCommonMinGW)
	cc = g++
endef
define setupMinGW421
	$(setupCommonMinGW)
	cc = g++-sjlj
endef
$(eval $(setup$(version)))